Texture mapping is a type of image processing and is used typically to give a three-dimensional or a two-dimensional object a particular surface appearance, e.g., the appearance of having a rough surface or of being composed of marble or granite or bricks. Texture mapping is well-known but is described briefly for completeness. Generally, a two-dimensional texture image, which typically specifies a textured pattern, is mapped to a surface of a graphical object. The result of rendering the graphical object on a computer display device after such texture mapping is the appearance that the textured pattern is on the surface of the rendered graphical object. For example, the texture image can be a two-dimensional image which is mottled grey which resembles the coloring and pattern of granite, and the object can be a three-dimensional chair. The result of mapping the granite texture image to the three-dimensional chair and rendering the chair is the display of the three-dimensional chair in a computer display device such that the chair appears to be made of granite. This appearance is achieved generally by combining with the color of each pixel of the graphical object the color of a corresponding texel of the texture image. Colors of corresponding texels and pixels can be combined in a number of ways, including various modulation, blending, replacing, and decal techniques.
Texture mapping typically requires substantial resources. Mapping a texture image to the surface of a graphical object typically involves misaligned pixels and texels. A pixel is an element of the picture, i.e., of the rendering in a computer display device, of a graphical object and has a single color. A texel is an element of a texture image and similarly has a single color. Mapping a texture image to a graphical object which is either not flat or not two-dimensional almost always results in misalignment of texels of the mapped texture image and pixels of the rendered image of the graphical object, i.e., results in texels and pixels which are not coincident in a common coordinate space. In addition, it is frequently desirable to scale a textured graphical object to a particular size and to scale the texture image accordingly. The scaling of a textured image can be used, for example, to represent distance from a viewer of the textured graphical object in a computer display device. Such scaling requires magnification or minification of the textured image to comport with the relative size of the graphical object, resulting in further misalignment of pixels and texels.
To combine the color of a pixel with the color of a texel in any of the ways listed above, coordinates of the pixel in the coordinate space of the texture image are determined and the color of the texel at those coordinates is retrieved from the texture image so that the colors can be combined. When a pixel is not aligned with any particular texel, the color of a texel corresponding to the pixel is generally derived from the texels nearest the pixel. In some conventional texture mappers, the color of the texel nearest the pixel is selected. However, mapping a texel to a pixel in this manner frequently results in undesirable effects in the rendering of the textured graphical object. It is usually preferred to interpolate a color between the colors of the texels nearest the pixel. Mapping an interpolated texel to the pixel and combining the color of the interpolated texel with the color of the pixel generally achieves a smooth, visually pleasing, desirable result.
In conventional texture mapping, the proximity of a pixel of the graphical object to each of the nearest four texels of the texture image is determined, and the weighted average of the colors of the four nearest texels is determined, based on the relative proximity of each of the texels to the pixels. The relative proximity of each of the texels to a particular pixel is calculated by (i) determining the distance between each of the texels and the pixel, (i) scaling the determined distances to produce respective weights for the texels, (iii) multiplying each component of the color of each texel by the respective weight of the texel, and (iv) summing the weighted components of the colors to form a weighted average color. Scaling each of the determined distances typically involves several arithmetic operations, requiring substantial computing resources.
For example, calculation of complementary weights for two texels near a pixel require two distance calculations (each typically involving at least a substraction operation), and a separate multiplication operation for each distance calculation. These operations are required for deriving a weighted average of only two texels in a single dimension. Typically, a weighted average of four texels in two dimensions is combined with the pixel. The most efficient of conventional texture mapping mechanisms repeats the above operations to form a weighted average of the remaining two texels and then repeats the above operations again to form an interpolated texel color which is a weighted average of the two previously calculated weighted averages. These operations represent a substantial component of the resources required to map a texture image to a graphical object.
Because of the substantial resources required in texture mapping a graphical image, a need for ever increasingly efficient texture mapping systems persists in the industry.